#pragma once
#include <thread>

#include "noncopyable.h"
#include "event_loop.h"
#include "mutex_guard.h"
#include "condition.h"

class EventLoopThread
{
public:
  EventLoopThread();
  ~EventLoopThread();
  EventLoop* startLoop();

private:
  void threadFunc();
  EventLoop* loop_;
  bool exiting_;

  std::thread thread_;
  Mutex mutex_;
  Condition cond_;
};